<?php
include APPPATH . 'views/cms/inc/01_head.php';
include APPPATH . 'views/cms/inc/05_top.php';
?>
<!-- Content container -->
<div id="container">
    <?php include APPPATH . 'views/cms/inc/04_cp_slidebar.php'; ?>
    <script type="text/javascript" src="/libraries/ckeditor/ckeditor.js" ></script>
    <script type="text/javascript" src="/libraries/cms/so/so.system.js" ></script>

    <!-- Content -->
    <div id="content">

        <!-- Content wrapper -->
        <div class="wrapper">

            <!-- Breadcrumbs line -->
            <div class="crumbs">
                <ul id="breadcrumbs" class="breadcrumb"> 
                    <li><a href="">CMS</a></li>
                    <li ><a href="#" title="">Service Operator</a></li>
                    <li class="active"><a href="#" title="">Module</a></li>
                </ul>

                <ul class="alt-buttons">
                    <li><a href="#" title=""><i class="icon-signal"></i><span>Stats</span></a></li>
                    <li><a href="#" title=""><i class="icon-comments"></i><span>Messages</span></a></li>
                    <li class="dropdown"><a href="/cms/ho" title="" ><i class="icon-tasks"></i><span>Tasks</span> <strong>(+16)</strong></a>

                    </li>
                </ul>
            </div>
            <!-- /breadcrumbs line -->

            <div class="actions-wrapper">
                <div class="wrapper" style="padding-top:20px">
                    <div class="widget" id="viewport">
                        <div class="navbar" >
                            <div class="navbar-inner" style="position:relative">
                                <h6><i class=" ico-th-large"></i>MODULE</h6>
                                <ul class="nav pull-right" style="position:relative;z-index:3">
                                    <li><a href="#" onclick="SM_SYSTEM.onAddItem()"><i class="icon-plus"></i>A D D</a></li>
                                    <li><a href="#" onclick="SM_SYSTEM.onRefresh()"><i class="icon-refresh"></i>REFRESH</a></li>
                                </ul>
                            </div>
                        </div>

                    </div>

                    <?php
                    if ($items) {
                        foreach ($items as $item) {
                            ?>
                            <form 
                                id="system_form_panel_<?php echo $item->Id ?>" 
                                name="system_form_panel_<?php echo $item->Id ?>" 
                                class="system_frm"
                                action="" method="POST" onsubmit="return false;"
                                target="integration_asynchronous" autocomplete="off">
                                <div class="widget" style="margin-bottom: 20px;">
                                    <div class="navbar">
                                        <div class="navbar-inner">
                                            <h6> <?php echo $item->Title ?></h6>
                                            <ul class="nav pull-right">
                                                <li><a href="JavaScript:" onclick="SM_SYSTEM.onSave('<?php echo $item->Id ?>');"><i class=" icon-save"></i>SAVE</a></li>
                                                <li class="dropdown">
                                                    <a href="components.html#" class="dropdown-toggle" data-toggle="dropdown"><i class=" icon-cog"></i> <b class="caret"></b></a>
                                                    <ul class="dropdown-menu pull-right">
                                                        <li><span onclick="SM_SYSTEM.addEditor('<?php echo $item->Id ?>');"><i class="icon-pencil"></i>ADD EDITOR</span></li>
                                                        <li><span onclick="SM_SYSTEM.removeEditor('<?php echo $item->Id ?>');"><i class="icon-remove"></i>REMOVE EDITOR</span></li>
                                                        <li><span onclick="SM_SYSTEM.toggleDesc('<?php echo $item->Id ?>');">DESCRIPTION</span></li>
                                                        <li><span onclick="SM_SYSTEM.onSave('<?php echo $item->Id ?>');"><i class="icon-save"></i>S A V E</span></li> 
<!--                                                        <li><span onclick="SM_SYSTEM.onDelete('<?php echo $item->Id ?>');"><i class="icon-trash"></i>D E L E T E</span></li> -->
                                                    </ul>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="row-fluid">
                                        <textarea rows="2" style="display: none"
                                                  name="Desc" 
                                                  class="span12 validate[required]"
                                                  data-prompt-position="topLeft:-1,-5"
                                                  placeholder="D E S C R I P T I O N"
                                                  ><?php echo $item->Desc ?></textarea>
                                        <textarea style="margin-top:1px" rows="5" 
                                                  name="Value" id="editor_value_<?php echo $item->Id ?>"
                                                  class="span12 validate[required]"
                                                  data-prompt-position="topLeft:-1,-5"
                                                  placeholder="V A L U E"
                                                  ><?php echo $item->Value ?></textarea>
                                        <input type="hidden" name="DataType" value="<?php echo $item->DataType ?>"/>
                                    </div>
                                </div>
                            </form>
                            <?php if($item->DataType=='html'){ ?>
                            <script type="text/javascript">
                                    addEditorBasic('editor_value_<?php echo $item->Id ?>');
                            </script>
                            <?php } ?>
                            <?php
                        }
                    }
                    ?>

                </div>
            </div>			
        </div>
        <!-- /content wrapper -->

    </div>
    <!-- /content -->

</div>
<!-- /content container -->
<?php include APPPATH . 'views/cms/inc/02_foot.php'; ?>


